﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel.Channels;

namespace STARShell.Core.Interfaces
{
    public static class ConfigurationUtility
    {
        public static Binding GetRouterBinding(string scheme)
        {
            Binding b = null;
            if (scheme == "http")
            {
                b = new CustomBinding(new TextMessageEncodingBindingElement(), new HttpTransportBindingElement { ManualAddressing = true });
            }
            else if (scheme == "net.tcp")
            {
                b = new CustomBinding(new BinaryMessageEncodingBindingElement(), new TcpTransportBindingElement { ManualAddressing = true });
            }
            else if (scheme == "net.pipe")
            {
                b = new CustomBinding(new BinaryMessageEncodingBindingElement(), new NamedPipeTransportBindingElement { ManualAddressing = true });
            }
            return b;
        }
    }
}
